package com.awonsome.shardingsphere.controller;

import com.awonsome.shardingsphere.pojo.entity.Order;
import com.awonsome.shardingsphere.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yangdejun
 * @date 2022/2/8 22:53
 */
@RestController
@RequestMapping(value = "/order")
public class OrderController {

    private final OrderService orderService;

    public OrderController(OrderService orderService) {
        this.orderService = orderService;
    }

    @GetMapping(value = "/save")
    public void save() {
        Order order = new Order();
        order.setOrderId(12345L);
        orderService.save(order);
    }
}
